import request from '@/utils/request'

export function addStock(data) {
  return request({
    url: '/stock',
    method: 'post',
    data
  })
}

export function delStock(id) {
  return request({
    url: '/stock',
    method: 'delete',
    params: {
      id: id
    }
  })
}

export function modifyStock(id, data) {
  return request({
    url: '/stock',
    method: 'put',
    data,
    params: {
      id: id
    }
  })
}

export function getStockList(payload) {
  return request({
    url: '/stock',
    method: 'get',
    params: {
      name: payload.name,
      page: payload.page,
      pageSize: payload.pageSize
    }
  })
}

export function getStockMaterialInfo(id) {
  return request({
    url: '/stock',
    method: 'get',
    params: {
      id: id
    }
  })
}
